import {createElement,createTextVnode} from './vnode';
function renderMixin(vm){
  vm._c= function(){
    // console.log(arguments)
    var result =  createElement(...arguments);
    // if(Object.keys(result.props.on).length !== 0){
    //   result.props.on.click = vm.$options.methods.clickFn
    // }
    // Object.keys(result.props).map(item =>{
    //   console.log(result)
    //   if(item && item.click){
        
    //   }
    // })
    return result
  }
  vm._s= function(value){
    if(value === null)return;
    return typeof value === 'object' ? JSON.stringify(value) :value;
  }
  vm._v= function(text){
    
    return createTextVnode(text);
  }
  vm._render = function(){
    const vm = this,
    render = vm.$options.render,
    vnode = render.call(this);
    //console.log(vnode)
    return vnode;
  }
}
export {renderMixin}